All Questions
8 questions
1vote
0answers
206views
Should I decouple MySQL database?
I have two sites, one is a subdomain of the other. They both do different things entirely with one unifying goal. My intent is to have the main site do a majority of the heavy lifting, and the ...
2votes
2answers
86views
Sql: Pre inserting relational entities vs the "lazy creation" of the entities
I have the following entities in my database (it's simplified): Student (id) StudentCourse (id, student_id, course_id) Course (id) Lesson (id) LessonCourse (id, lesson_id, course_id) ...
5votes
3answers
3kviews
How to enforce the mandatory participation constraint at the many end in a one-to-many relationship?
Say I have the following ER diagram: Enforcing the mandatory participation constraint at the one end is easy, I simply make the foreign key (school_id) in Student NOT NULL. But how can I enforce the ...
11votes
2answers
10kviews
Is indexing foreign keys a good practice?
Looking at DB tables created by a different developer I have noticed that whenever a table had a forein_key_id field/column, it was always an INDEX/KEY. I am not sure if it was manually created, or ...
3votes
3answers
1kviews
Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?
I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return ...
1vote
1answer
1kviews
Store data for multiple User Type
I am developing an app where four types of user share same module. So is it a good idea to create: one table and user_type and user_id (something like that) table prefixes basically 4 diff tables of ...
1vote
2answers
552views
Why OTServs have an item cloning problem if the server crashes? [closed]
OTServs are open source MMORPGs with a huge community. Mostly all of them have a serious problem: if the server crashes, people can clone items. This is a dirty trick that can be executed because the ...
5votes
2answers
520views
Storing stop/start points in a database
Let's say I am storing start and stop points per user into a database table. For example... let's say in a chat system, a user only needs to see lines 24-293, and 500-512. (Let's say he logged off ...